<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">

	$(function(){
		$("button").click(function(){
			alert("sdfa");	
			$.ajax({
				type:'post',
				url:"test/myAjax.do",
				data:{name:"张三",
					age:19},
				success:function(data){
					console.log(data);
				}
			});
		});
		
		$('#btn1').click(function(){
			alert("123");
			$.ajax({
				type:'post',
				url:"test/myAjax1.do",
				data:{name:"张三",
					age:19},
				success:function(data){
					console.log(data);
				}
			});
		})
		
		$('#btn2').click(function(){
			alert("123");
			$.ajax({
				type:'post',
				url:"test/myAjax2.do",
				data:{name:"张三",
					age:19},
				success:function(data){
					console.log("%O",data);
				}
			});
		})
		
		$('#btn3').click(function(){
			alert("123");
			$.ajax({
				type:'post',
				url:"test/myAjax3.do",
				data:{name:"张三",
					age:19},
				success:function(data){
					console.log("%O",data);
				}
			});
		})
		
	});
	

</script>
<body>
	<h2>Hello World!</h2>
	<a href="test/my.do">跳转到welcome页面</a>
	<br>
	<form action="${pageContext.request.contextPath}/test/register.do"
		method="post">
		姓名：<input type="text" name="name" /> <br> 年龄：<input type="text"
			name="age" /> <br> <input type="submit" value="注册" />

	</form>
	<br>
	<button>提交Ajax请求</button>
	<br>
	<input id="btn1" type="button" value="提交Ajax请求,返回数据1">
	<input id="btn2" type="button" value="提交Ajax请求,返回数据2">
	<input id="btn3" type="button" value="提交Ajax请求,返回数据3">
</body>
</html>
